/*
 *  Value.cpp
 *  OfflineTranslator
 *
 *  Created by PH on 5.9.10.
 *  Copyright 2010 Petr Homola. All rights reserved.
 *
 */

#include "stdafx.h"
#include "Value.h"
#include "AVM.h"

namespace nlp {
	
	/*string Value::description() const {
		string s = _string;
		//if (avm != NULL) s += "/" + avm->description();
		return s;
	}*/
	
	Value::Value(shared_ptr<AVM> _avm) {
		avm = _avm;
		//ownsAvm = o;
		//avm->retain();
		//empty = false;
	}
	
	Value::Value(const Value& value) {
		_string = value._string;
		avm = value.avm;
		//avm->retain();
		//empty = false;
		//cout << "2-" << _string << endl;
	}	
	
	Value::~Value() {
		//if (avm != NULL && ownsAvm) delete avm; //avm->release();
	}
	
	bool Value::equals(const Value& v) const {
		return _string == v._string && ((avm == NULL && v.avm == NULL) || avm->equals(v.getAvm()));
	}
	
}
